package me.zhengjie.vo.mes;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ResponseResult<T> {

    private Integer returnCode;

    private String returnReason;

    private T returnData;

    public static  <T> ResponseResult<T> success(T data) {
        return new ResponseResult<>(200, "success", data);
    }
    public static <T> ResponseResult<T>  error() {
        return new ResponseResult<>(500, "操作失败！", null);
    }
    public static <T> ResponseResult<T>  error(String returnReason) {
        return new ResponseResult<>(500, returnReason, null);
    }
}
